// LevelDB.cpp : implementation file
//

#include "stdafx.h"
#include "LevelDB.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CLevelDB

// for static member
CString CLevelDB::m_DSN;
CString CLevelDB::m_Table;
CString CLevelDB::m_UID;
CString CLevelDB::m_Pass;


IMPLEMENT_DYNAMIC(CLevelDB, CRecordset)

CLevelDB::CLevelDB(CDatabase* pdb)
	: CRecordset(pdb)
{
	//{{AFX_FIELD_INIT(CLevelDB)
	m_ID = _T("");
	m_RankLevel = 0;
	m_nFields = 2;
	//}}AFX_FIELD_INIT
	m_nDefaultType = snapshot;
}


CString CLevelDB::GetDefaultConnect()
{
	//return _T("ODBC;DSN=NetmarbleUserDB;UID=Sqladmin;PWD=net885;");
	CString rtn;
	rtn.Format("ODBC;DSN=%s;UID=%s;PWD=%s;", (LPCTSTR)m_DSN, (LPCTSTR)m_UID, (LPCTSTR)m_Pass);
	return rtn;
}

CString CLevelDB::GetDefaultSQL()
{
	//return _T("[AssaultGearLevelDB]");
	CString rtn;
	rtn.Format("%s", (LPCTSTR)m_Table);
	return rtn;
}

void CLevelDB::DoFieldExchange(CFieldExchange* pFX)
{
	//{{AFX_FIELD_MAP(CLevelDB)
	pFX->SetFieldType(CFieldExchange::outputColumn);
	RFX_Text(pFX, _T("[ID]"), m_ID);
	RFX_Long(pFX, _T("[RankLevel]"), m_RankLevel);
	//}}AFX_FIELD_MAP
}

/////////////////////////////////////////////////////////////////////////////
// CLevelDB diagnostics

#ifdef _DEBUG
void CLevelDB::AssertValid() const
{
	CRecordset::AssertValid();
}

void CLevelDB::Dump(CDumpContext& dc) const
{
	CRecordset::Dump(dc);
}
#endif //_DEBUG
